home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n22.arc / CURDR.ASM < prev    next >
Assembly Source File  |  1991-12-08  |  1KB  |  36 lines

  1. ;**********************************************************************
  2. ; CURDR.ASM         Get Current Drive Letter              dBASE .BIN
  3. ;
  4. ; Author..: Sal Ricciardi
  5. ;
  6. ; Create with:   TASM curdrive  (Borland Turbo Assembler 2.5)
  7. ;                TLINK curdrive
  8. ;                EXE2BIN curdrive
  9. ;                DEL CURDR.OBJ
  10. ;                DEL CURDR.MAP
  11. ;                DEL CURDR.EXE
  12. ;
  13. ; Usage:  (dBASE III Plus, FoxBASE+, dBASE IV)
  14. ;
  15. ; .cdrive = ' '
  16. ; .LOAD CURDR
  17. ; .CALL CURDR WITH cdrive          && Don't forget the parameter
  18. ; .RELEASE MODULE CURDR
  19. ;
  20. ;**********************************************************************
  21.               .MODEL SMALL
  22.               .CODE
  23. curdr         PROC  FAR                         ;entry point
  24.               push  ax                          ;save registers
  25.               mov   ax,ds                       ;try to check for
  26.               or    ax,bx                       ;missing parm
  27.               jz    @@1                         ;jmp if ds==0
  28.               mov   ah,19h                      ;get current drive
  29.               int   21h                         ;dos interrupt
  30.               add   al,'A'                      ;convert number to letter
  31.               mov   BYTE PTR ds:[bx],al         ;store in parameter
  32. @@1:          pop   ax                          ;restore register
  33.               ret                               ;return to caller
  34. curdr         ENDP
  35.               END   curdr
  36.